# 类型  整型  浮点型  字符串  布尔
# a = 10
# print(type(a))# <class 'int'>  可自动扩容
# b = 3.1415926
# print(type(b))# <class 'float'>  == double
# c = "hello world"
# print(type(c))# <class 'str'>
# d = True
# print(type(d))# <class 'bool'>

# a = "hello "
# b = "world"
# print(a+b)

# 注释三种
# '''   '''
#  #
#  ctrl + /
# a = 10
# print(f"输出的数字是{a}")

# '''
# a = 10
# print(f"输出的数字是{a}")
# '''

# 输入和输出
# f-string结构

# b = 3.14
# print(f"输出的数字为{b}")
# {}里面可以是变量也可以是表达式
# b = 3.14
# print(f"输出的数字是{b+1}")
# input
# num = input("请输入一个数字： ")
# print(f"输入的数字是{num}")
# input返回值是字符串，如果想要用来计算则需要强制转换
# int ()
# num2 = input("please input a number :")
# num2 = int(num2)
# result = num2+10
# print(result)

# a = 3.14
# a = int(a)
# print(a)

# 预算符 + - * / % ** //
# a = 10
# b = 2
# print(a+b)
# print(a-b)
# print(a*b)
# print(a/b)
# a = 7
# b = 3
# print(a % b)
# **可以是大于1的数字也可以是小于1的数字

# print(2 ** 3)
# print(4 ** 0.5)
# // 地板除，即取整
# print(9 // 4)
# print(-9 // 4)

# 关系预算符  ---- 返回值为True or False
# a = 10
# b = 20
# c = 30
# print(a > b)
# print(a < b < c)  # python 里可以连比
#
# 逻辑运算符
# and or not

# a = 10
# b = 20
# c = 30
# print(a < b < c)
# print(a < b and b < c)
# print(not(a < b or b > c))
# 短路运算  ---  and前面错后面不在计算  or 前面对后面不在计算
# a = 10
# b = 20
# c = 30
# print(a < b or b / 0)
# print(a < b and b / 0)

# 赋值预算符
# a = 10
# a += 2
# print(a)
#
# a = 10
# a *= 2
# print(a)

# a = input("请输入一个数字 ：")
# print(a)
# print(f"a的类型为{type(a)}")

#交换两个数字
# a = 10
# b = 20
# temp = a
# a = b
# b = temp
# print(a,b)  #print里的逗号变成空格

# a,b = 10,20
# print(a,b)

# a = 10
# b = 20
# a,b = b,a
# print(a,b)
